define(['common/js/service/boss-common-service-0.1'],
function() {
	serviceModule.factory("UserService",function($window, $http,CommonRestService, $q){
		return {
			login: function(httpParams){
				var deferred = $q.defer();
				$http({method:  globalVar.methodPost, url: globalVar.loginPath, timeout: 60000,params:httpParams}).
				success(function(data, status) {
					deferred.resolve(data);
				}).
				error(function(data, status) {
					deferred.reject(null);
				});
				return deferred.promise;
			},
			logout:function(){
				var deferred = $q.defer();
				$http({method:  globalVar.methodPost, url: globalVar.logoutPath, timeout: 60000}).
				success(function(data, status) {
					deferred.resolve(data);
				}).
				error(function(data, status) {
					deferred.reject(null);
				});
				return deferred.promise;
			}
		};
	});
});
